package MP.staticchecker;

public class FunctionType extends Type {
	Type pType = null;
	Type rType = null;
	
	public FunctionType(Type p, Type r) {
		pType = p;
		rType =r;
	}
	public Type getReturnType() {
		return rType;
	}
	public Type getParameterType() {
		return pType;
	}
	public String toString() {
		return (pType==null?"null":pType.toString())+"->"+rType.toString();
	}
	public String getJVMType() {
		if (pType == null)
			return "()"+rType.getJVMType();
		return "("+pType.getJVMType()+")"+rType.getJVMType();
	}
}
